package org.java.item.feigns;

import org.java.common.vo.ResultVo;
import org.java.item.entity.Sku;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @author WHQ
 * @version 1.0
 * @date 2022-3-5 0005 下午 3:37
 */
public interface SkuApi {
    @GetMapping("/query/list")
    public ResultVo<Sku> getList(@RequestParam("page")int page, @RequestParam("limit")int limit);

    @GetMapping("/find/{id}")
    public Sku findById(@PathVariable("id")Long id);

    /**
     *减库存的接口
     * @param skuId
     * @param num
     */
    @PostMapping("/cut/inventory")
    public void cutInventory(@RequestParam Long skuId, @RequestParam Integer num);

    /**
     * 库存回滚的接口
     * @param skuId
     * @param inventory
     */
    @PutMapping("/rollback/inventory")
    public void rollbackInventory(@RequestParam Long skuId, @RequestParam Long inventory);
}
